"use client"
import { useState } from 'react'
/**
 * 该模块作用是：当children更新时，template也会更新，而layout则不会刷新
 */
export default function DashboardTemplate({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  const [count, setCount] = useState(0)
  return (
    <div className="border-2 border-dashed border-black p-4 mt-10">
      <h2>Dashboard Template {count}</h2>
      <button className="bg-blue-500 text-white px-4 rounded" 
              onClick={() => { setCount(count + 1)}}
      >+1</button>
      {children}
    </div>
  )
} 